﻿@model IEnumerable<PrjctMngmt.Models.TaskCategory>

@{
    ViewBag.Title = "Create a task category";
    var odd = false;
}

<h2>Create a task category</h2>

<p>
    @Html.ActionLink("Add new task category", "Create")
</p>

@if (Model.Count() > 0)
{
    <div class="datagrid">
        <table>
            <thead>
                <tr>
                    <th>
                        Name
                    </th>
                    <th>
                    </th>
                </tr>
            </thead>
            @foreach (var item in Model)
            {
                <tbody>
                    <tr class="@(odd ? "alt" : "")">
                        <td>
                            @Html.DisplayFor(modelItem => item.Name)
                        </td>
                        <td>
                            @Html.ActionLink("Edit", "Edit", new { id = item.Name }) |
                            @Html.ActionLink("Details", "Details", new { id = item.Name }) |
                            @Html.ActionLink("Delete", "Delete", new { id = item.Name })
                        </td>
                    </tr>
                    @{ odd = !odd; }
                </tbody>
            }
        </table>
        @{ odd = false; }
    </div>
}
else
{
    <p>
        Task categories not found.
    </p>
}
<div>
    <br />
    @Html.ActionLink("Back to tasks", "Index", "Task")
</div>
